<?php
session_start();
$fileName = $_FILES["filedata"]["name"];
$extPos = strrpos($fileName,'.');
$ext = substr($fileName,$extPos+1);
$newName =  date('Ymd').time().rand(100,999).'.'.$ext;  //同时上传人数过多的话仍可能重复
move_uploaded_file($_FILES["filedata"]["tmp_name"], "uploadimg/" . $newName);
echo ("uploadimg/" .$newName);
?>
